package com.young.springdemo.service.abstractFactory;

import com.young.springdemo.service.factoryMethod.Factory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//@Component
public class Test {

//    @PostConstruct
    public void test(){
        try {
            Class<?> aClass = Class.forName("com.young.springdemo.service.abstractFactory.WinterFactory");
            SkinFactory factory = (SkinFactory) aClass.newInstance();
            factory.createButton().display();
            factory.createCheckBox().display();
            factory.createTextField().display();
            factory.createCombox().display();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
